clear;
clc;

m = 64;
n = 5;                     %Data size
r = 1;                      %Rank

RU = randn(m,r)+10;
RV = randn(r,n)+20;
% load patch
% pixel = 64;
% method = 5;
% X_Ori = repmat(patch,1,method);
X_Ori = RU * RV;        %Original data
Ind = randperm(m*n);
p1 = floor(m*n*0.2);

X_Noi = X_Ori;

p2 = floor(m*n*0.2);
X_Noi(Ind(p1+1:p1+p2)) = X_Noi(Ind(p1+1:p1+p2)) + randn(1,p2)* 0.8; %Add uniform noise
p3 = floor(m*n*0.2);
X_Noi(Ind(p1+p2+1:p1+p2+p3)) = X_Noi(Ind(p1+p2+1:p1+p2+p3)) + randn(1,p3)* 2; %Add Gaussian noise
X_Noi(Ind(p1+p2+p3+1:end)) = X_Noi(Ind(p1+p2+p3+1:end)) + randn(1,m*n-p1-p2-p3)* 5; %Add Gaussian noise

cln = X_Ori;
nos = X_Noi;
save random cln nos